<?php
include_once 'include.php';
$id = $_REQUEST['id'];
$message = find('lyy_message','content','del=1 and id='.$id);//查回复留言的内容
$sql = "select a.id,a.content,a.createtime,b.username,b.email from lyy_message a 
JOIN lyy_member b ON a.uid=b.id WHERE pid = $id";#分页
$res = mysqli_query(conn(),$sql);#执行操作
$lists = mysqli_fetch_all($res,MYSQLI_ASSOC);#留言回复列表
?>
<!DOCTYPE html>
<html>
<head>
    <?php include_once 'common_js_css.php'?>
	<link rel="stylesheet" type="text/css" href="css/kejian.css">
</head>
<body marginheight="0">
    <div class="cont" style="height: 910px">
        <div class="flash">
            <span><h1>关于“ <?php echo $message['content'];?>  ”留言的回复</h1></span>
        </div>
        <hr style="height:1px;border:none;border-top:2px solid blue;" />
        <form name="form2" method="post" action="">
          <table width="980" class="ta"  style="border-collapse:separate; border-spacing:0px 0px;">
              <thead>
              <tr height="40">
                  <td colspan="4">
                      <div class="container">
                          <a style="line-height: 50px; font-size: 20px;text-align: right;" href="javascript:;">我要回复</a> </div>
                  </td>
              </tr>
                <tr class="tr1" height="40">
                  <td width="50" align="center" valign="middle">用户账号</td>
                  <td width="50" align="center">邮箱地址</td>
                  <td width="240" align="center">回复内容</td>
                  <td width="100" align="center">回复时间</td>
                </tr>
              </thead>
              <?php if ($lists): ?>
              <tbody id="ppt">
              <?php foreach ($lists as $list): ?>
                  <tr height="40">
                      <td align="center" valign="middle"><?php echo $list['username']; ?></td>
                      <td align="center"><?php echo $list['email']; ?></td>
                      <td align="center"><?php echo $list['content']; ?></td>
                      <td align="center"><?php echo date('Y-m-d H:i:s',$list['createtime']); ?></td>
                  </tr>
              <?php endforeach; ?>
              </tbody>
              <?php else: ?>
              <tr><td height="40" colspan="4" align="center" style="color: red">暂无回复内容</td></tr>
              <?php endif; ?>
          </table>
        </form>
    </div>

    <!--弹窗内容-->
    <div class="fulled">
        <div class="fix-box">
            <p class="close">关闭</p>
            <span>我要回复</span>
            <table>
                <tr>
                    <td>内容:</td>
                    <td><textarea rows="10" cols="30" id="content"></textarea></td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><input type="button" value="提交" onclick="add_reply('<?php echo $id; ?>')"></td>
                </tr>
            </table>
        </div>
    </div>
</body>
</html>